#include "struct.h"

void display_func(p_node list, Book book)
{
    if (list->count <= 0)
        printf("该系统中没有书籍\n");
    else
    {
        printf("该系统中有%d本不同的书籍,每本书籍的信息如下：\n", list->count);
        printf("=======================\n");

        p_node current = list->next;

        while (current != NULL)
        {
            // 显示这本书的信息
            printf("书名:%s\t作者:%s\tISBN:%s\t出版社:%s\t年份:%d\t库存:%d\t已借出数量:%d\n",
                   current->data.title, current->data.author, current->data.isbn, current->data.publisher,
                   current->data.year, current->data.stock, current->data.borrowed);

            current = current->next;
        } 
    }
}